package com.birdy.util;

import com.birdy.con.AppConst;
import com.birdy.dto.Response;

/**
 * @author birdy
 * @date 2022/3/31 12:38 PM
 */
public class AppTokenHelper {
    public Response getOpenIdAndSessionKey(String code) {
        String url = "https://api.weixin.qq.com/sns/jscode2session?" +
                "appid=" + AppConst.APP_ID + "&secret="
                + AppConst.APP_SECRET + "&js_code=" + code +
                "&grant_type=authorization_code";
        return new AppHttpHelper().getAppSessionKeyAndOpenid(url);
    }
}
